//
//  YWHistoryCollectionViewCell.m
//  聆听FM
//
//  Created by dllo on 16/6/22.
//  Copyright © 2016年 Dark. All rights reserved.
//

#import "YWHistoryCollectionViewCell.h"

@implementation YWHistoryCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.textLabel = [[UILabel alloc] initWithFrame:self.bounds];
        _textLabel.font = [UIFont systemFontOfSize:13];
        _textLabel.layer.cornerRadius = self.bounds.size.height / 2 - 2;
        _textLabel.layer.borderWidth = 1;
        _textLabel.layer.borderColor = [UIColor colorWithWhite:0.783 alpha:1.000].CGColor;
        [self.contentView addSubview:_textLabel];
        
        self.tempLabel = [[UILabel alloc] init];
        _tempLabel.font = [UIFont systemFontOfSize:13];
    }
    return self;
}

- (void)setTextString:(NSString *)textString
{
    if (_textString != textString) {
        _textString = textString;
        _tempLabel.text = textString;
        [_tempLabel sizeToFit];
        _textLabel.text = textString;
        if (_tempLabel.bounds.size.width < (SCREENWIDTH - 40) / 3) {
            [_textLabel sizeToFit];
        }
    }
}

@end
